package com.ricky.config;

import java.util.List;
import java.util.Map;

import com.ricky.config.Unit.BuildingUnit;
import com.ricky.config.Unit.GoodsUnit;
import com.ricky.config.Unit.HeroUnit;
import com.ricky.config.scene.SceneConfig;

/**
 * 配置数据中心
 * 
 * @author rik
 * 
 */
public class ConfigData {
	/**
	 * 服务器配置信息
	 */
	public static ServerInfo serverinfo;
	
	/**
	 * 英雄配置数据
	 */
	private static Map<String,HeroUnit> heroUnitConfig;
	
	/**
	 * 物品单位配置
	 */
	private static Map<String,GoodsUnit> goodsUnitConfig;
	
	/**
	 * 建筑单位配置
	 */
	private static Map<String,BuildingUnit> buildingUnitConfig;
	
	/**
	 * 场景配置
	 */
	private static Map<String,SceneConfig> sceneConfig;
	
	//******************************** get set *****************************************
	
	/**
	 * 英雄配置数据
	 */
	public static Map<String,HeroUnit> getHeroUnitConfig() {
		return heroUnitConfig;
	}

	/**
	 * 英雄配置数据
	 */
	public static void setHeroUnitConfig(Map<String,HeroUnit> heroUnitConfig) {
		ConfigData.heroUnitConfig = heroUnitConfig;
	}

	/**
	 * @return the goodsUnitConfig
	 */
	public static Map<String,GoodsUnit> getGoodsUnitConfig() {
		return goodsUnitConfig;
	}

	/**
	 * @param goodsUnitConfig the goodsUnitConfig to set
	 */
	public static void setGoodsUnitConfig(Map<String,GoodsUnit> goodsUnitConfig) {
		ConfigData.goodsUnitConfig = goodsUnitConfig;
	}

	/**
	 * @return the buildingUnitConfig
	 */
	public static Map<String,BuildingUnit> getBuildingUnitConfig() {
		return buildingUnitConfig;
	}

	/**
	 * @param buildingUnitConfig the buildingUnitConfig to set
	 */
	public static void setBuildingUnitConfig(Map<String,BuildingUnit> buildingUnitConfig) {
		ConfigData.buildingUnitConfig = buildingUnitConfig;
	}
	
	//***************************** public ****************************************
	/**
	 * 得到英雄配置数据
	 * @param unitId
	 * @return
	 */
	public static HeroUnit getHeroUnit(String unitId)
	{
		HeroUnit re=null;
		re=heroUnitConfig.get(unitId);
		return re;
	}
	
	/**
	 * 得到物品配置数据
	 * @param unitId
	 * @return
	 */
	public static GoodsUnit getGoodsUnit(String unitId)
	{
		GoodsUnit re=null;
		re=goodsUnitConfig.get(unitId);
		return re;
	}
	
	/**
	 * 得到建筑配置数据
	 * @param unitId
	 * @return
	 */
	public static BuildingUnit getBuildingUnit(String unitId)
	{
		BuildingUnit re=null;
		re=buildingUnitConfig.get(unitId);
		return re;
	}

	/**
	 * @return the sceneConfig
	 */
	public static Map<String,SceneConfig> getSceneConfig() {
		return sceneConfig;
	}

	/**
	 * @param sceneConfig the sceneConfig to set
	 */
	public static void setSceneConfig(Map<String,SceneConfig> sceneConfig) {
		ConfigData.sceneConfig = sceneConfig;
	}
}
